/*
 * @Descripttion:
 * @version:
 * @Author: kl2018
 * @Date: 2019-03-07 20:06:20
 * @LastEditors: kl2018
 * @LastEditTime: 2020-08-18 14:15:20
 */
import { observable, action } from 'mobx';
import { WeaTableNew } from 'comsMobx';
import * as API_REPORT from '../../apis/reportApi';

const { TableStore } = WeaTableNew;

/**
 * 公文报表对话框  数据对象
 */
export default class ReportFlowEchartDetailListDialogStore {
  @observable visable = false;

  @observable condition_base = {};
  @observable condition_name = '';


  @observable tableStore = new TableStore();

  constructor() {
    this.doSearch = this.doSearch.bind(this);
  }

  @action
  setCondition_base = (condition_base) => {
    this.condition_base = condition_base;
  }


  setSearchsBaseValue(v) {
    this.condition_name = v;
  }


  doSearch(params = {}) {
    API_REPORT.getOdocReportEchartDetailList(params).then((data) => {
      this.tableStore.getDatas(data.sessionkey, params.current || 1);
    });
    return this;
  }


  showDialog() {
    this.visable = true;
  }

  hideDialog = () => {
    this.visable = false;
    this.condition_name = '';
  }
}
